#pragma GCC optimize(2, "Ofast", "inline")
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <algorithm>
#define endl '\n'
#define int long long
#define pii pair<int, int>
#define int128 __int128
using namespace std;

// 已知
int n, k, ai;
// 未知
int128 ans = 1;
int t = 1;

void write(int128 x)
{
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}
signed main()
{
    cin >> n >> k;
    for (int i = 0;i < k;++i) t *= 10;
    for (int i = 0;i < n;++i)
    {
        cin >> ai;
        ans *= ai;
        if (ans >= t) ans = 1;
    }
    write(ans);
    return 0;
}